home *** CD-ROM | disk | FTP | other *** search
- ////////////////////////////////////////////////////////////////////////////////////////////
- //
- // PRODUCT: Norton Internet Security/Symantec Desktop Firewall
- //
- // NAME: wiz-SetPasswords (Javascript file for wiz-SetPasswords.HTM)
- //
- // Copyright (c) by Symantec Corporation. All rights reserved.
- //
- ////////////////////////////////////////////////////////////////////////////////////////////
-
- var m_iCurrentPage = 1;
-
- var NOT_PRESENT =0;
- var PRESENT = 1;
- var PRESENT_FAKE=2;
-
-
- function GetCurrentUser()
- {
- var sProductType = UserManager.ProductType;
-
- UserName.innerText = window.parent.aAccounts[m_iCurrentPage - 1].m_sAccountName;
-
- // Set the user type
- switch(window.parent.aAccounts[m_iCurrentPage - 1].m_iAccountType)
- {
-
- case "0":
- if (sProductType == "PT_PRO")
- {
- UserType.innerText = StrID("ParentalProductivityRestricted_NISPRO_Caps");
- }
- else
- {
- UserType.innerText = StrID("ParentalProductivityRestricted_NIS_Caps");
- }
- break;
-
- case "1":
- UserType.innerText = StrID("ParentalProductivityTeenager");
- break;
-
- case "2":
- if (sProductType == "PT_PRO")
- {
- UserType.innerText = StrID("ParentalProductivityStandard_NISPRO_Caps");
- }
- else
- {
- UserType.innerText = StrID("ParentalProductivityStandard_NIS_Caps");
- }
- break;
-
- case "3":
- UserType.innerText = StrID("ParentalProductivitySupervisor");
- break;
-
- default:
- UserType.innerText = StrID("ParentalProductivity_ThisErrorShouldNeverOccur");
- }
- }
-
- function SavePassword()
- {
- window.parent.SetAccountInfo(m_iCurrentPage - 1, null, Pass.value, null);
- }
-
- function OnLoad()
- {
-
- // Disable NextButton so user cannot constantly click next.
- window.parent.frames("bottom").NextB.disabled = true;
-
- // If no accounts were created we can skip the "Set Password" page by simulating "Next Click"
- if (window.parent.m_iAccounts < 1)
- {
- window.parent.frames("bottom",0).GoNext("Set Password");
-
- }
- else
- {
- GetCurrentUser(); // Get First User
- CurrentNum.innerText = m_iCurrentPage;
- TotalNum.innerText = window.parent.m_iAccounts;
- }
-
- // Enable NextButton
- window.parent.frames("bottom").NextB.disabled = false;
- }
-
-
- function Page_GoNext()
- {
- try
- {
- // Disable NextButton so user cannot constantly click next.
- window.parent.frames("bottom").NextB.disabled = true;
-
- if (m_iCurrentPage < window.parent.m_iAccounts)
- {
- // Check Password if it is valid
- if(Pass.value != PassConfirm.value)
- {
- alert(StrID("ParentalProductivity_PasswordError"));
- window.parent.frames("bottom").NextB.disabled = false;
- return false;
- }
-
- // If password in empty pass in empty string
- if(!Pass.value)
- {
- Pass.value = "";
- }
-
- SavePassword(); // Save Password off
-
- // Now update the page for next user
- m_iCurrentPage++; // Increment "user" count
- CurrentNum.innerText = m_iCurrentPage; // Update text that refers to user count
- Pass.value = ""; // Clear password fields
- PassConfirm.value = "";
- GetCurrentUser(); // Get Next user info
-
- Pass.focus();
-
- window.parent.frames("bottom").NextB.disabled = false;
- return false; // Return False because we do not want to go "next" just yet
- }
- else
- {
- // Check Last Password if it is valid
- if(Pass.value != PassConfirm.value)
- {
- alert(StrID("ParentalProductivity_PasswordError"));
- window.parent.frames("bottom").NextB.disabled = false;
- return false;
- }
-
- // If password in empty pass in empty string
- if(!Pass.value)
- {
- Pass.value = "";
- }
-
- SavePassword(); // Save off last password
-
- // Now save off each account
- for (i = 0; i < window.parent.m_iAccounts; i++)
- {
- // Now go ahead and create each account;
- var name = window.parent.aAccounts[i].m_sAccountName;
-
- if(!name || name == "")
- name = " ";
-
- // call WrapUM to create this account
- UserManager.CreateAccount(window.parent.aAccounts[i].m_sAccountName,
- window.parent.aAccounts[i].m_sAccountPassword,
- window.parent.aAccounts[i].m_iAccountType);
- }
-
- // Enable NextButton
- window.parent.frames("bottom").NextB.disabled = false;
- return true;
- }
- }
- catch(err)
- {
- window.parent.frames("bottom").NextB.disabled = false;
- }
- }
-
-
- function Page_GoBack()
- {
- return true;
- }
-
- function OnKeyDownHandler()
- {
- // Last Control Tab over to the <back, next, close> button.
- var VK_ESCAPE = 27;
-
- if (window.event.keyCode == VK_ESCAPE)
- {
- // Escape key.. We want to exit out of the wizard..
- parent.window.navigate("res://closeme.xyz");
- }
- }
-